app.config   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 50

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 50
rs 9.3333
c 0
b 0
f 0
cc 1
nc 1
nop 8

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
/*
2
 * @copyright Copyright (c) 2016 Julius Härtl <[email protected]>
3
 *
4
 * @author Julius Härtl <[email protected]>
5
 *
6
 * @license GNU AGPL version 3 or any later version
7
 *  
8
 *  This program is free software: you can redistribute it and/or modify
9
 *  it under the terms of the GNU Affero General Public License as
10
 *  published by the Free Software Foundation, either version 3 of the
11
 *  License, or (at your option) any later version.
12
 *  
13
 *  This program is distributed in the hope that it will be useful,
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 *  GNU Affero General Public License for more details.
17
 *  
18
 *  You should have received a copy of the GNU Affero General Public License
19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 *  
21
 */
22
23
app.config(function ($provide, $routeProvider, $interpolateProvider, $httpProvider, $urlRouterProvider, $stateProvider, $compileProvider, markdownItConverterProvider) {
24
    'use strict';
25
    $httpProvider.defaults.headers.common.requesttoken = oc_requesttoken;
0 ignored issues
show
Bug introduced by
The variable oc_requesttoken seems to be never declared. If this is a global, consider adding a /** global: oc_requesttoken */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
26
27
    $compileProvider.debugInfoEnabled(true);
28
29
    markdownItConverterProvider.config({
30
        breaks: true,
31
        linkify: true,
32
        xhtmlOut: true
33
    });
34
    markdownItConverterProvider.use(markdownitLinkTarget);
0 ignored issues
show
Bug introduced by
The variable markdownitLinkTarget seems to be never declared. If this is a global, consider adding a /** global: markdownitLinkTarget */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
35
36
    $urlRouterProvider.otherwise("/");
37
38
    $stateProvider
39
        .state('list', {
40
            url: "/",
41
            templateUrl: "/boardlist.mainView.html",
42
            controller: 'ListController'
43
		})
44
        .state('board', {
45
            url: "/board/:boardId/:filter",
46
            templateUrl: "/board.html",
47
            controller: 'BoardController',
48
            params: {
49
                filter: { value: '', dynamic: true }
50
            }
51
        })
52
        .state('board.detail', {
53
            url: "/detail/",
54
            reloadOnSearch : false,
55
            views: {
56
                "sidebarView": {
57
                    templateUrl: "/board.sidebarView.html"
58
				}
59
            }
60
		})
61
        .state('board.card', {
62
            url: "/card/:cardId",
63
            views: {
64
                "sidebarView": {
65
                    templateUrl: "/card.sidebarView.html",
66
                    controller: 'CardController'
67
                }
68
            }
69
        });
70
71
72
});